﻿@model ExternalAuth.WeixinOpen.Models.ConfigurationModel
@{ 
    Layout = "_LayuiAdminLayout";
}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">配置&nbsp;&nbsp;&nbsp;<a href="javascript:;" layadmin-event="back">返回</a></div>
                <div class="layui-card-body">
                    <div class="layui-form" wid100 lay-filter="">
                        <div class="layui-form-item">
                            <div class="col-md-2">
                                <label class="layui-form-label" for="AppId">开发者ID(AppID)</label>
                            </div>
                            <div class="layui-input-inline" style="width:800px;">
                                <u-editor asp-for="AppId" />
                                <span asp-validation-for="AppId"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="col-md-2">
                                <label class="layui-form-label" for="AppSecret">开发者密码(AppSecret)</label>
                            </div>
                            <div class="layui-input-inline" style="width:800px;">
                                <u-editor asp-for="AppSecret"></u-editor>
                                <span asp-validation-for="AppSecret"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="set_system_email">确认保存</button>
                            </div>
                        </div>
                    </div>
                    <div style="padding-top: 30px;">
                        <a href="javascript:;" layadmin-event="back" class="layui-btn layui-btn-primary layui-btn-sm">返回上级</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set'], function () {
        var $ = layui.$
            , form = layui.form;
        form.on('submit(set_system_email)', function (obj) {
          var field = obj.field; //获取提交的字段
            //layer.msg(JSON.stringify(obj.field));
            //提交 Ajax 成功后，关闭当前弹层并重载表格
            $.post('@Url.Action("Configure")', field, function (rep) {
                if (rep.success==1)
              layer.msg('保存成功');
            });
            return false;
    });
    });
</script>